package com.ihr360.binlog.dto;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.io.Serializable;
import java.util.Date;

@Entity
public class CanalConfig implements Serializable {
    @Id
    private Long id;
    @Column(length = 100)
    private String host;
    @Column(length = 40)
    private Integer port;
    @Column(length = 40)
    private String destination;
    @Column(length = 40)
    private String username;
    @Column(length = 40)
    private String password;
    @Column(length = 40)
    private String filter;
    @Column(length = 200)
    private String syncTableFilter;
    @Column(length = 200)
    private String genTableEventFilter;

    private Boolean isUp;
    @Column(columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdated;

    private Boolean isEnabled;

    private Boolean error;

    @Column(length = 2000)
    private String errorMessage;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFilter() {
        return filter;
    }

    public void setFilter(String filter) {
        this.filter = filter;
    }

    public String getSyncTableFilter() {
        return syncTableFilter;
    }

    public void setSyncTableFilter(String syncTableFilter) {
        this.syncTableFilter = syncTableFilter;
    }

    public String getGenTableEventFilter() {
        return genTableEventFilter;
    }

    public void setGenTableEventFilter(String genTableEventFilter) {
        this.genTableEventFilter = genTableEventFilter;
    }

    public Boolean getIsUp() {
        return isUp;
    }

    public void setIsUp(Boolean isUp) {
        this.isUp = isUp;
    }

    public Date getLastUpdated() {
        return lastUpdated;
    }

    public void setLastUpdated(Date lastUpdated) {
        this.lastUpdated = lastUpdated;
    }

    public Boolean getIsEnabled() {
        return isEnabled;
    }

    public void setIsEnabled(Boolean isEnabled) {
        this.isEnabled = isEnabled;
    }

    public Boolean getError() {
        return error;
    }

    public void setError(Boolean error) {
        this.error = error;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }
}